#include "simple_gl.h"

#define	MAX_PARTICLES	25
#define	MENU_DOWN	0
#define	MENU_UP		1
#define	MENU_LEFT	2
#define	MENU_RIGHT	3

#define STATE_MENU	0
#define STATE_GAME	1
#define STATE_OPTIONS	2

#define MOVE_LEFT	0
#define MOVE_RIGHT	1
#define MOVE_DOWN	2
#define MOVE_NONE	5

#define BLOCK_EMPTY	0
#define BLOCK_YELLOW	8
#define BLOCK_RED	2
#define BLOCK_PURPLE	3
#define BLOCK_BLUE	4
#define BLOCK_CYAN	5
#define BLOCK_ORANGE	6
#define BLOCK_GREEN 	7


extern int exitFlag;
extern int gameState;

typedef unsigned char byte;

typedef struct {
	int shape[4][4];
	int width;
	int height;
	int x;
	int y;
	int dropOffset;
} Game_playerBlock;

typedef struct {
	float x;
	float y;
	float rotation;
	float rotation_speed;
	float size;
	float speed;
	int type1;
	int type2;
	float accel;
} Game_particle;

int Game_Init();
void Game_Render();
void Game_DrawBackground();
void renderParticle(Game_particle *p);

void Game_MenuMove(int direction);
void Game_MenuOK();
void Game_MoveBlock(int moveCode);
void Game_RotateBlock();
void Game_DropBlock();
void Game_FadeAndChangeState(int changeState);
void Game_MoveDown(byte moveOffset);
void Game_Start();
void Game_NewBlock();

byte blockCollision(byte x, byte y, byte moveCode);
void Init_Particles();
